{% extends 'app_planning/index.html' %}
{% block own_js %}
    {{ block.super }}
    <script src="{{STATIC_URL}}js/planner_grafico.js"></script>
{% endblock %}

{% block app_planning %}
    <h1>{{ planning.title }}</h1>
    <p>{{ planning.description}}</p>
    
    {% include "app_planning/planning_grafico.html" %}

    <ul>
        {% for action in planning.action_set.all %}
            <li>
                <a href="{% url view_action action.id %}">{{ action.title }}</a>
                - {{ action.description }}
                - {{ action.tags }}
                <a href="{% url delete_action action.id %}" class="close">×</a>
                <ul>
                    {% for ts in action.timeslot_set.all %}
                    <li>
                        {{ ts.get_day_display }}: 
                        {{ ts.ini_time }}
                         - {{ ts.end_time }}
                        <a href="{% url delete_timeslot ts.id %}" class="close">×</a>
                    </li>
                    {% endfor %}
                </ul>
            </li>
        {% endfor %}
        <a href="{% url new_action planning.id %}" class="btn btn-primary">Nueva acción</a>
    </ul>
{% endblock %}
